package com.my12306.train.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.my12306.common.model.vo.PageVo;
import com.my12306.train.model.entity.TrainEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 列车表
 *
 * @author ËÕÄÁÏ¦
 * @email
 * @date 2020-07-24 20:58:07
 */
@Mapper
public interface TrainDao extends BaseMapper<TrainEntity> {
    /**
     * 分页查询
     *
     * @param pageVo
     * @param logicDelete
     * @return
     */
    List<TrainEntity> queryTrainPage(@Param("pageVo") PageVo pageVo, @Param("logicDelete") int logicDelete);

    /**
     * 分页查询总数
     *
     * @param pageVo
     * @param logicDelete
     * @return
     */
    Integer queryTrainCount(PageVo pageVo, Integer logicDelete);

    /**
     * 根据ids批量删除列车
     *
     * @param trainIds
     * @param logicDelete
     */
    void deleteTrainBatchByIds(@Param("list") List<Long> trainIds, @Param("logicDelete") Integer logicDelete);

    /**
     * 查询所有列车
     * @param logicDelete
     * @return
     */
    List<TrainEntity> queryAllTrain(@Param("logicDelete") int logicDelete);


    /**
     * 查询所有列车类型
     * @param logicDelete
     * @return
     */
    List<String> queryAllTrainType(@Param("logicDelete") int logicDelete);
}
